package com.huluobo.a2109mouthdemo.mine;

import com.huluobo.a2109mouthdemo.base.BasePresenter;
import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient;

/**
 * Created by LC on 2023/12/1.
 */
public class MinePresenter extends BasePresenter<MineContract.View> implements MineContract.Presenter {
    @Override
    public void logout() {
        if (isAttach()) {
            getView().onStartLogout();
            EMClient.getInstance().logout(true, new EMCallBack() {
                @Override
                public void onSuccess() {
                    getView().onLogoutSuccess();
                }

                @Override
                public void onError(int code, String error) {
                    getView().onLogoutFailed(error);
                }
            });
        }
    }
}
